package com.emeraldparser.symbol;

import com.emeraldparser.util.HashCodes;

public final class EndOfInputSymbolClass extends AtomicSymbolClass {

	private final transient int hashCode;

	public EndOfInputSymbolClass() {
		this.hashCode = HashCodes.classSpecificHashCode(EndOfInputSymbolClass.class);
	}

	@Override
	public String toString() {
		return "$";
	}

	@Override
	public int hashCode() {
		return hashCode;
	}

	@Override
	public boolean equals(Object obj) {
		if (this == obj) {
			return true;
		}
		
		if (obj == null) {
			return false;
		}
		
		if (getClass() != obj.getClass()) {
			return false;
		}
		
		return true;
	}

	@Override
	public <I, O> O accept(SymbolClassVisitor<I, O> visitor, I input) {
		return visitor.visitEndOfInputSymbolClass(this, input);
	}

}
